package com.hy.service.impl;

import com.hy.bean.Buytable;
import com.hy.bean.RespBean;
import com.hy.dao.BuytableDao;
import com.hy.dao.impl.BuytableDaoImpl;
import com.hy.service.BuytableService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class BuytableServiceImpl implements BuytableService {

    BuytableDao buytableDao = new BuytableDaoImpl();

    @Override
    public List<Map<String,Object>> queryAllByLimit(Integer page, Integer limit) throws Exception {

        return buytableDao.queryAllByLimit(page,limit);
    }

    @Override
    public RespBean getBuyTableState(String state) {
        return new RespBean(200,"ok",buytableDao.selectBuyTableState(state));
    }

    @Override
    public long count() throws Exception {
        return buytableDao.count();
    }

    @Override
    public long countDetails(Integer id) throws Exception {
        return buytableDao.countDetails(id);
    }

    @Override
    public List<Map<String, Object>> queryAllDetails(Integer id, Integer page, Integer limit) throws Exception {
        return buytableDao.queryAllDetails(id,page,limit);
    }
}